Specifying Pointer Structures by Graph Reduction
نویسندگان
چکیده
Graph-reduction specifications (GRSs) are a powerful new method for specifying classes of pointer data structures (shapes). They cover important shapes, like various forms of balanced trees, that cannot be handled by existing methods. This report formally defines GRSs as graph-reduction systems with a signature restriction and an accepting graph. We are mainly interested in PGRSs, which are polynomially-terminating GRSs whose graph languages are closed under reduction. PGRS languages have a polynomial membership test, making them a computationally well-behaved formalism for specifying graph languages. We investigate the power of the PGRS framework by presenting example shapes within and beyond its scope and by considering its language closure properties under intersection, union and complement: PGRS languages are closed under intersection; not closed under union (unless we drop the closedness restriction and exclude languages with the empty graph); and not closed under complement. Our practical investigation shows how nil pointers can be modelled and presents a wide variety of example PGRSs including lists, cyclic lists, trees, threaded trees, various balanced trees and grids. In each case we try to provide the simplest possible PGRS where simplicity means the fewest rules, the simplest possible termination and confluence proofs and the fewest non-terminals. We show how to prove the correctness of a PGRS and give methods for demonstrating that a given shape cannot be specified by a PGRS with certain simplicity properties. The theory is implemented in a checking tool available from the project webpage [SPG]. Work partly funded by the EPSRC project Safe Pointers by Graph Transformation[SPG], grant GR/R72440/01. A short version of this report will appear in [BPR03b].
منابع مشابه
Extending C for Checking Shape Safety
The project Safe Pointers by Graph Transformation at the University of York has developed a method for specifying the shape of pointer-data structures by graph reduction, and a static checking algorithm for proving the shape safety of graph transformation rules modelling operations on pointer structures. In this paper, we outline how to apply this approach to the C programming language. We exte...
متن کاملGraph transformation and pointer structures
This thesis is concerned with the use of graph-transformation rules to specify and manipulate pointer structures. In it, we show that graph transformation can form the basis of a practical and well-formalised approach to specifying pointer properties. We also show that graph transformation rules can be used as an efficient mechanism for checking the properties of graphs. We make context-sensiti...
متن کاملA Needed Rewriting Strategy for Data-Structures with Pointers
We propose a reduction strategy for systems of rewrite rules operating on term-graphs. These term-graphs are intended to encode pointer-based data-structures that are commonly used in programming, with cycles and sharing. We show that this reduction strategy is optimal w.r.t. a given dependency schema, which intuitively encodes the “interferences” among the nodes in the term-graph. We provide a...
متن کاملFrom imperative to rule-based graph programs
The use of graphs to model dynamic structures is ubiquitous in computer science; prominent example areas include compiler construction, pointer programming, natural language processing, and model-driven software development. The behaviour of systems in such areas can be naturally captured by graph transformation rules specifying small state changes. Domain-specific languages based on graph tran...
متن کاملWho is Pointing When to Whom? On the Automated Verification of Linked List Structures
This paper introduces an extension of linear temporal logic that allows to express properties about systems that are composed of entities (like objects) that can refer to each other via pointers. Our logic is focused on specifying properties about the dynamic evolution (such as creation, adaptation, and removal) of such pointer structures. The semantics is based on automata on infinite words, e...
متن کامل